/* global window*/
import dva from 'dva';
import './index.html';
import router from './router';
import user from './models/user';

const DESIGN_WIDTH = 750;
const REM_BASE = 36;
const docEl = window.document.documentElement;
const screenWidth = docEl.getBoundingClientRect().width || window.innerWidth;
const fontSize = (screenWidth / DESIGN_WIDTH) * REM_BASE;
docEl.style.fontSize = `${fontSize}px`;
const screenHeight = docEl.getBoundingClientRect().height || window.height;
const root = window.document.body;
root.style.height = `${screenHeight}px`;
window.rate = screenWidth / screenHeight;
// 1. Initialize
const app = dva();

// 2. Plugins
// app.use({});

// 3. Model
app.model(user);

// 4. Router
app.router(router);

// 5. Start
app.start('#root');
